import java.util.ArrayList;

/**
 * Project: SecuritySnort
 * This class will take care of printing the collected IP Addresses.
 *
 * @author Jonathan Buttner
 * @version Mar 6, 2010
 */
public class TallyIPCmd extends Command
{
	/**************************************************************************
	 * 							Globals
	 *************************************************************************/
	private IPSaver _tallyIP;
	
	/**************************************************************************
	 * 							Constructors
	 *************************************************************************/
	/**
	 * This constructor sets up the object.
	 * 
	 * @param saver is the structure used to save the seen IP Addresses.
	 */
	public TallyIPCmd( IPSaver saver )
	{
		_tallyIP = saver;
		_name = "tallyipmac";
	}
	
	/**************************************************************************
	 * 							Public Methods
	 *************************************************************************/
	public void exeCommand( ArrayList < String > cmdline )
	{
		System.out.println( "\nCollected IP Addresses of captured packets:" );
		System.out.println( "\n" + _tallyIP.printTree() );	
	}
}
